package Thread;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.PriorityBlockingQueue;

public class Demo9 {
    public static void main(String[] args) throws InterruptedException {
        //基于数组
        BlockingQueue <String> blockingQueue=new ArrayBlockingQueue<>(1000);
        //基于链表
        BlockingQueue<String> blockingQueue1=new LinkedBlockingQueue<>();
        //基于堆
        BlockingQueue<String> blockingQueue2=new PriorityBlockingQueue<>();
        blockingQueue.put("aaa");
        String elem=blockingQueue.take();
    }
}
